import { http } from "@/utils/http";
import type { ResultTable } from "@/api/type";
import type {
  FormItemProps,
  Result
} from "@/views/system/generator/utils/types";

const modulePath = "/system/generators";

/** 列表 */
export const getGeneratorsList = (params?: object) => {
  return http.request<ResultTable>("get", modulePath + "/list", {
    params
  });
};

/** 新增 */
export const generatorsAdd = (data?: FormItemProps) => {
  return http.request<Result>("post", modulePath + "/add", { data });
};

/** 修改 */
export const generatorsUpdate = (data?: FormItemProps) => {
  return http.request<Result>("put", modulePath + "/update", {
    data
  });
};

/** 删除 */
export const generatorsDel = (data: object) => {
  return http.request<Result>("delete", modulePath + "/delete", {
    data
  });
};
